Dim e As IEnumerable(Of KeyValuePair(Of Integer, Integer)) = New KeyValuePair(Of Integer, Integer)(0) {}
Dim ordered As OrderedKeyValuePairs(Of Integer, Integer)
ordered = New OrderedKeyValuePairs(Of Integer, Integer)(e)
Assert.IsTrue(TypeOf ordered.Comparer Is KeyValueComparer(Of Integer, Integer))
Assert.IsTrue(ReferenceEquals(Comparer(Of Integer).[Default], (DirectCast(ordered.Comparer, KeyValueComparer(Of Integer, Integer))).Comparer))
Assert.AreEqual(DuplicateHandling.None, ordered.DuplicateHandling)
Assert.AreEqual(&H10000, ordered.InMemoryLimit)
Assert.AreEqual(Nothing, ordered.Serializer)
ordered = New OrderedKeyValuePairs(Of Integer, Integer)(New ReverseOrder(Of Integer)(Comparer(Of Integer).[Default]), e)
Assert.IsTrue(TypeOf ordered.Comparer Is KeyValueComparer(Of Integer, Integer))
Assert.IsTrue(TypeOf (DirectCast(ordered.Comparer, KeyValueComparer(Of Integer, Integer))).Comparer Is ReverseOrder(Of Integer))
Assert.AreEqual(DuplicateHandling.None, ordered.DuplicateHandling)
Assert.AreEqual(&H10000, ordered.InMemoryLimit)
Assert.AreEqual(Nothing, ordered.Serializer)
Dim ser As New KeyValueSerializer(Of Integer, Integer)(PrimitiveSerializer.Int32, PrimitiveSerializer.Int32)
ordered = New OrderedKeyValuePairs(Of Integer, Integer)(New ReverseOrder(Of Integer)(Comparer(Of Integer).[Default]), e, ser)
Assert.IsTrue(TypeOf ordered.Comparer Is KeyValueComparer(Of Integer, Integer))
Assert.IsTrue(TypeOf (DirectCast(ordered.Comparer, KeyValueComparer(Of Integer, Integer))).Comparer Is ReverseOrder(Of Integer))
Assert.AreEqual(DuplicateHandling.None, ordered.DuplicateHandling)
Assert.AreEqual(&H10000, ordered.InMemoryLimit)
Assert.AreEqual(ser, ordered.Serializer)
ordered = New OrderedKeyValuePairs(Of Integer, Integer)(New ReverseOrder(Of Integer)(Comparer(Of Integer).[Default]), e, ser, 42)
Assert.IsTrue(TypeOf ordered.Comparer Is KeyValueComparer(Of Integer, Integer))
Assert.IsTrue(TypeOf (DirectCast(ordered.Comparer, KeyValueComparer(Of Integer, Integer))).Comparer Is ReverseOrder(Of Integer))
Assert.AreEqual(DuplicateHandling.None, ordered.DuplicateHandling)
Assert.AreEqual(42, ordered.InMemoryLimit)
Assert.AreEqual(ser, ordered.Serializer)
ordered = New OrderedKeyValuePairs(Of Integer, Integer)(New ReverseOrder(Of Integer)(Comparer(Of Integer).[Default]), e, PrimitiveSerializer.Int32, PrimitiveSerializer.Int32)
Assert.IsTrue(TypeOf ordered.Comparer Is KeyValueComparer(Of Integer, Integer))
Assert.IsTrue(TypeOf (DirectCast(ordered.Comparer, KeyValueComparer(Of Integer, Integer))).Comparer Is ReverseOrder(Of Integer))
Assert.AreEqual(DuplicateHandling.None, ordered.DuplicateHandling)
Assert.AreEqual(&H10000, ordered.InMemoryLimit)
Assert.IsNotNull(ordered.Serializer)
ordered = New OrderedKeyValuePairs(Of Integer, Integer)(New ReverseOrder(Of Integer)(Comparer(Of Integer).[Default]), e, PrimitiveSerializer.Int32, PrimitiveSerializer.Int32, 42)
Assert.IsTrue(TypeOf ordered.Comparer Is KeyValueComparer(Of Integer, Integer))
Assert.IsTrue(TypeOf (DirectCast(ordered.Comparer, KeyValueComparer(Of Integer, Integer))).Comparer Is ReverseOrder(Of Integer))
Assert.AreEqual(DuplicateHandling.None, ordered.DuplicateHandling)
Assert.AreEqual(42, ordered.InMemoryLimit)
Assert.IsNotNull(ordered.Serializer) |